package main

import (
	"fmt"
	"time"
)

func print() {
	for i := 0; i < 10; i++ {
		fmt.Println(i)
	}
}

func div() {
	defer func() {
		err := recover()
		if err != nil {
			fmt.Println("div()出现错误：", err)
		}
	}()

	num1 := 10
	num2 := 0

	fmt.Println("num1除以num2等于", num1/num2)
}

func main() {
	go print()
	go div()

	time.Sleep(time.Second * 5)
}
